package com.network.web;

import com.network.web.config.BaiduConfig;
import com.network.web.config.ReceiptConfig;
import com.network.web.receipt.BaiduService;
import com.network.web.receipt.ReceiptService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;

/**
 * @author 28162
 */
@SpringBootApplication
@EnableConfigurationProperties({BaiduConfig.class, ReceiptConfig.class})
public class RunReceipt {
    @Resource
    private BaiduService baiduService;
    @Resource
    private ReceiptService receiptService;

    public static void main(String[] args) {
        SpringApplication.run(RunReceipt.class, args);
    }

    @Bean
    public CommandLineRunner commandLineRunner() {
        return args -> printApplicationProperties();
    }

    public void printApplicationProperties() {
//        baiduService.getHomePage();
//        receiptService.requestReceiptInfo();
    }
}
